package com.link.play.fit.ai.ui.view;

import android.content.Context;

import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatTextView;

public class UnlimitedText  extends AppCompatTextView {
    public UnlimitedText(@NonNull Context context) {
        super(context);
    }
    private void init() {
        setSingleLine(true);
        setEllipsize(null);
        setHorizontallyScrolling(true);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        // 强制解除宽度限制
        int newWidthSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
        super.onMeasure(newWidthSpec, heightMeasureSpec);
    }
}
